package chapter15;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lzy
 * Date: 2018/5/12
 */
public class FruitTestDemo {
    public static void main(String[] args) {
        List<Apple> apples = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            apples.add(new Apple());
        }
        List<? extends Fruit> flist = apples;
        System.out.println(flist.get(1).getClass());
        System.out.println(flist.contains(new Apple()));
        System.out.println(flist.indexOf(new Apple()));
    }
}
